package day_2022_4_to_7.day48;

import java.util.Scanner;

/**
 * 回文统计
 * @author haomin
 * @date 2022/04/22 21:29
 **/
public class Day5_1_PalindromeSum {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        String s1 = in.next();
        String s2 = in.next();

        int count = 0;
        for (int i = 0; i <= s1.length(); i++) {
            String ret1 = s1.substring(0,i);
            String ret2 = s1.substring(i,s1.length());
            String result = ret1 + s2 + ret2;

            // 得到合并串
            if(isPalindrome(result)){
                count++;
            }
        }
        System.out.println(count);
    }

    private static boolean isPalindrome(String s) {
        char[] data = s.toCharArray();
        String ret = "";
        for (int i = data.length-1; i >= 0 ; i--) {
            ret+=data[i];
        }
        return ret .equals(s) ? true : false;
    }
}
